{% extends 'layout_login.html' %}

{% block page_title %}Register an Account{% endblock %}

{% block content %}
<div class="login-box">
  <div class="tl"></div>
  <div class="tr"></div>
  <div class="bl"></div>
  <div class="br"></div>

  <h1>Register</h1>
  <div class="h1-continuation">a new {{ site.name }} account.</div>

  <form action="/account/register/" method="post" id="login-form">
    <div class="form-row">
      <label for="id_first_name">First name:</label>
      {{ form.first_name }}
      {% if form.errors.first_name %}
        <div class="margin-error">{{ form.errors.first_name.0 }}</div>
      {% endif %}
    </div>

    <div class="form-row">
      <label for="id_last_name">Last name:</label>
      {{ form.last_name }}
      {% if form.errors.last_name %}
        <div class="margin-error">{{ form.errors.last_name.0 }}</div>
      {% endif %}
    </div>

    <div class="form-spacer"></div>

    <div class="form-row">
      <label for="id_email">E-mail address:</label>
      {{ form.email }}
      {% if form.errors.email %}
        <div class="margin-error">{{ form.errors.email.0 }}</div>
      {% else %}
        <div class="margin-note">
        Only used for password recovery and opt-in notifications.
        </div>
      {% endif %}
    </div>

    <div class="form-spacer"></div>

    <div class="form-row">
      <label for="id_username">Username:</label>
      {{ form.username }}
      {% if form.errors.username %}
        <div class="margin-error">{{ form.errors.username.0 }}</div>
      {% else %}
        <div class="margin-note">
        This does not need to match your revision control username(s).
        </div>
      {% endif %}
    </div>

    <div class="form-row">
      <label for="id_password">Password:</label>
      <input type="password" class="text" name="password" id="id_password" />
      {% if form.errors.password %}
        <div class="margin-error">{{ form.errors.password.0 }}</div>
      {% endif %}
    </div>

    <div class="form-row">
      <label for="id_password2">Re-type password:</label>
      <input type="password" class="text" name="password2" id="id_password2" />
      {% if form.errors.password2 %}
        <div class="margin-error">{{ form.errors.password2.0 }}</div>
      {% endif %}
    </div>

    <div class="form-row">
      {% include "security_widget.html" %}
    </div>

    <div class="submit-row">
      <div>&raquo;</div>
      <input type="submit" value="Sign up" />
      {% if form.errors.submit %}
        <div class="margin-error">{{ form.errors.submit.0 }}</div>
      {% endif %}
    </div>

  </form>
</div>

<ul class="options-box">
<li>The account you create here will not be publicly visible.</li>
<li>If you already have an author name on {{ site.name }}, your new username does not need to match it.</li>
<li>The e-mail address you provide here will never be publicly visible,
    nor will it ever be distributed to third parties.
    <p>It will only be used to help you recover
       lost passwords, and to notify you of events (such as project ownership
       disputes) when you specifically opt-in for such notifications.
   </p>
</li>
</ul>

<script type="text/javascript">
document.getElementById('id_first_name').focus()
</script>
{% endblock %}
